package com.wanmait.wisdom.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wanmait.wisdom.entity.ResidentType;
import com.wanmait.wisdom.mapper.ResidentTypeMapper;
import com.wanmait.wisdom.web.service.WebResidentTypeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional(rollbackFor = Exception.class)
public class WebResidentTypeServiceImpl extends ServiceImpl<ResidentTypeMapper, ResidentType> implements WebResidentTypeService {
    @Resource
    private ResidentTypeMapper baseMapper;
    @Override
    public ResidentType findById(Integer id) {
        LambdaQueryWrapper<ResidentType> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ResidentType::getId, id);
        return baseMapper.selectOne(queryWrapper);
    }
}
